/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */

#ifndef __NOISE_DATA_SOURCE_XM_H__
#define __NOISE_DATA_SOURCE_XM_H__

#include <SharedRep.h>
#include "DataSource.h"
#include <filesystem/String.hpp>
#include <vector>
#include <logs/Log.h>

class XMPlayer;

namespace liba
{
namespace noise
{

class DataSourceXM : public DataSource
{
	XMPlayer * xm_player;
	int samples_decoded;
	std::vector<char> decoded_data;
public:
	explicit DataSourceXM( const filesystem::String & file_name );
	virtual ~DataSourceXM();
	bool is_valid()const;
	virtual int get_frequency();
	virtual bool has_native(Type channel);
	virtual int get_length()
	{
		return 0;
	}
	virtual int decode(int samples);
	virtual void get_data(Type channel, void * dst, int dst_stride, int dst_bits);
};

} // namespace noise
} // namesapce liba
using namespace liba;

#endif //__NOISE_DATA_SOURCE_XM_H__

